package com.lijiajia.cloud.authserver.security.oauth.publisher;

import lombok.extern.slf4j.Slf4j;
import org.springframework.security.authentication.AuthenticationEventPublisher;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;

/**
 * 认证事件通知
 *
 * @author lijiajia
 * @since 2019-04-03
 */
@Slf4j
public class CloudAuthenticationPublisher implements AuthenticationEventPublisher {
    @Override
    public void publishAuthenticationSuccess(Authentication authentication) {
        log.debug("auth success {}", authentication);
    }

    @Override
    public void publishAuthenticationFailure(AuthenticationException exception, Authentication authentication) {
        log.debug("auth fail {}", authentication);
        log.debug("auth fail exception", exception);
    }
}
